/**
 * Author: Dmitry Ustimov
 * Date: 6/1/13
 * Time: 10:08 PM
 */

package com.gmail.dmitryustimov.ms.java7.chain_of_responsibility.classic.work.demo.handlers6_request1;

public class Demo {

    public static void main(String[] args) {

        Handler h1 = new CocreteHandler1("CocreteHandler1", 1);
        Handler h2 = new CocreteHandler2("CocreteHandler2", 2);
        Handler h3 = new CocreteHandler3("CocreteHandler3", 3);
        Handler h4 = new CocreteHandler4("CocreteHandler4", 4);
        Handler h5 = new CocreteHandler5("CocreteHandler5", 5);
        Handler h6 = new CocreteHandler6("CocreteHandler6", 6);

        h1.setNext(h2);
        h2.setNext(h3);
        h3.setNext(h4);
        h4.setNext(h5);
        h5.setNext(h6);

        Request request1 = new Request1("Request1", 4);

        h1.handle(request1);
        h1.handleChain(request1);
    }
}
